﻿<UserControl x:Class="Projecturo.ProjecturoClient.View.ProjectAdministrationView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ctrl="clr-namespace:Projecturo.ProjecturoClient.Controls"
    Height="Auto" Width="Auto">
    <DockPanel LastChildFill="True">
        <GroupBox Header="Project" DockPanel.Dock="Top">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="Project: "/>
                <TextBlock Text="{Binding Name}"/>
            </StackPanel>
        </GroupBox>
        <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal">
            <Button Content="New Milestone" Command="{Binding AddMilestoneCommand}"/>
            <Button Content="Save" Command="{Binding SaveCommand}"/>
        </StackPanel>
        <GroupBox Header="Categories/Versions" DockPanel.Dock="Top">
            <StackPanel Orientation="Horizontal">
                <DockPanel LastChildFill="True" MinHeight="120" MaxHeight="120" MinWidth="200" MaxWidth="200">
                    <DockPanel DockPanel.Dock="Top">
                        <Button Content="Add Category" Command="{Binding AddCategoryCommand}" CommandParameter="{Binding ElementName=CategoryBox,Path=Text}" DockPanel.Dock="Right"/>
                        <TextBox x:Name="CategoryBox"/>
                    </DockPanel>
                    <ListBox ItemsSource="{Binding Categories}" ItemTemplate="{StaticResource CategoryListTemplate}"/>
                </DockPanel>
                <DockPanel LastChildFill="True" MinHeight="120" MaxHeight="120" MinWidth="200" MaxWidth="200">
                    <DockPanel DockPanel.Dock="Top">
                        <Button Content="Add Version" Command="{Binding AddVersionCommand}" CommandParameter="{Binding ElementName=VersionBox,Path=Text}" DockPanel.Dock="Right"/>
                        <TextBox x:Name="VersionBox"/>
                    </DockPanel>
                    <ListBox ItemsSource="{Binding Versions}" ItemTemplate="{StaticResource VersionListTemplate}"/>
                </DockPanel>
            </StackPanel>
        </GroupBox>
        <GroupBox Header="Milestones" DockPanel.Dock="Top">
            <ListView ItemsSource="{Binding Milestones}">
                <ListView.View>
                    <GridView>
                        <GridViewColumn CellTemplate="{StaticResource EditMilestoneTemplate}" Header="Milestone"/>
                        <GridViewColumn Header="Finishing Date" DisplayMemberBinding="{Binding Path=FinishingDate,StringFormat={}{0:d}}"/>
                    </GridView>
                </ListView.View>
            </ListView>
        </GroupBox>
        <GroupBox Header="Status">
            <ctrl:TicketStateMappingControl TicketStates="{Binding TicketStates}" StateMappings="{Binding StateMappings}"/>
        </GroupBox>
    </DockPanel>
</UserControl>
